package com.yaowk.web.common.exception;

import com.yaowk.api.common.BaseException;
import com.yaowk.web.common.model.Result;
import com.yaowk.web.common.utils.ResultUtils;
import org.springframework.web.bind.annotation.*;

@ControllerAdvice(annotations = RestController.class)
@ResponseBody
public class BaseExceptionAdvice {

    @ExceptionHandler(BaseException.class)
    public Result baseException(BaseException e){
        return ResultUtils.result(Result.Code.FAIL.getValue(), e.getMessage());
    }
}
